<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h1>
            mixin学习
        </h1>
    </div>
</body>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    var mymixin = {
        // 创建之后 
        created:function(){
            this.hello()
        },
        methods:{
            hello:function(){
                console.log('我进入mixin的hello里面了')
            }
        }
    }
    var app = new Vue({
         mixins:[mymixin],
        el: '#app',
        data: {
            fruits: ['apple', 'pear', 'banana', 'orange']
        },
        
    })


</script>

</html>